package data;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Place {
	private String _id;
	private String _name;
	
	public Place(String placeId, String placeName) {
		_id = placeId;
		_name = placeName;
	}
	
	public Place(DataInputStream dis) {
		try {
			_id = dis.readUTF();
			_name = dis.readUTF();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public String id() {
		return _id;
	}
	
	public String name() {
		return _name;
	}
	
	public void write(DataOutputStream dos) {
		try {
			dos.writeUTF(_id);
			dos.writeUTF(_name);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
